<template>
  <div>
    <c-table
      border
      :loading="loading"
      :stripe="false"
      :columns="tableColumns"
      :data="govMessageLoanLending"
    ></c-table>
    <div class="query-pagination">
      <div></div>
      <el-pagination
        layout="total, prev, pager, next, jumper"
        :current-page.sync="params.index"
        :page-size="govMessagePageSize"
        :total="govMessageLoanLendingCount"
        @current-change="getData"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
import { dateFormat } from '@/common/utils/common'

export const tableColumns = [
  { attrs: { label: '已放款主体', prop: 'customer_name', align: 'center' } },
  { attrs: { label: '负责人', prop: 'res_a_name', align: 'center' } },
  { attrs: { label: '联系电话', prop: 'res_a_phone', align: 'center' } },
  { attrs: { label: '放款银行', prop: 'bank_name', align: 'center' } },
  {
    attrs: { label: '放款时间', prop: 'load_date', align: 'center' },
    process: v => dateFormat(v, 'yyyy-MM-dd'),
  },
  {
    attrs: { label: '放款金额', prop: 'reply_funds', align: 'center' },
    process: v => (v ? `${v}万元` : '-'),
  },
]

export default {
  components: {},
  props: {},
  data() {
    return {
      params: {
        index: 1,
      },
      tableColumns,
    }
  },
  computed: {
    ...mapGetters(['govMessageLoanLendingCount', 'govMessageLoanLending', 'govMessagePageSize']),
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    async getData() {
      this.loading = true
      await this.$utils.promise(this.$store.dispatch('getGovMessageLoanLending', this.params))
      this.loading = false
    },
  },
}
</script>
<style lang="scss" scoped></style>
